-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the default icon for the navigation block #44104
Conversation
Size Change: -2 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves the warnings for me, thanks for addressing it so quickly.
@@ -92,7 +92,7 @@ function Navigation( { | |||
flexWrap = 'wrap', | |||
} = {}, | |||
hasIcon, | |||
icon, | |||
icon = 'handle', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The block does have a default attribute of 'handle', so this may not be required, but I don't mind a bit of extra safety.
What?
Fix the default icon for the navigation block. Now the icon always fallback to the "handle" icon to preserve backward-compatibility, and to match both in the editor and in the frontend.
Why?
A follow-up to #43674 (comment). Fix the PHP error of accessing an undefined index.
How?
By adding
isset()
to the PHP code and fallback to the handle icon in React.I'm not sure if it's worth it to require the icon to be defined and stored in the serialized output?
Testing Instructions